﻿using SuperX.Common;
using System;
using System.Collections.Generic;
using System.Text;

namespace SuperX.Helper.TreeUtil
{
    /// <summary>
    /// 驱动树
    /// </summary>
    public class BaseTreeNode
    {
        /// <summary>
        /// 子id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 父id
        /// </summary>
        public string ParentId { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 预配置驱动名
        /// </summary>
        public string PreDriverName { get; set; }

        public string AssemblyName { get; set; }

        public string ClassFullName { get; set; }

        /// <summary>
        /// 分组类别
        /// </summary>
        public TagType TagType { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public List<BaseTreeNode> Children { get; set; }

        /// <summary>
        /// 无参构造函数
        /// </summary>
        public BaseTreeNode()
        {
            Children = new List<BaseTreeNode>();
        }

        /// <summary>
        /// 有参构造函数
        /// </summary>
        /// <param name="id">子id</param>
        /// <param name="name">名称</param>
        /// <param name="parentId">父id</param>
        public BaseTreeNode(string id, string name, string parentId)
        {
            this.Id = id;
            this.Name = name;
            this.ParentId = parentId;
            Children = new List<BaseTreeNode>();
        }

        /// <summary>
        /// 有参构造函数
        /// </summary>
        /// <param name="id">子id</param>
        /// <param name="name">名称</param>
        /// <param name="parent">父节点</param>
        public BaseTreeNode(string id, string name, BaseTreeNode parent)
        {
            this.Id = id;
            this.Name = name;
            this.ParentId = parent.Id;
            Children = new List<BaseTreeNode>();
        }
    }
}